// 朴素莫队
// https://www.luogu.com.cn/problem/P1494
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
using namespace std;
using ll = long long;
using T = int;
T rad(); // quick read
const int inf = 0x3f3f3f3f;
#define rf(i, n) for (int i = 1; i <= (n); ++i)
const int max_size = 5 + 100;
const int maxn = 5 + 5e4;

int bsiz; // block_size
struct ASK {
    int l, r;
    int id;
    ll ans;
    bool operator<(const ASK &b) const { return id < b.id; }
} ask[maxn];
bool coder(const ASK &a, const ASK &b) {
    if (a.l / bsiz != b.l / bsiz) return a.l / bsiz < b.l / bsiz;
    return (a.l / bsiz & 1) ? a.r < b.r : a.r > b.r; // 奇偶化排序
}

int n, m;
int a[maxn];

ll now_ans; // sum(c_{cnt[x], 2})
int cnt[maxn];

inline ll C(int n, int k) {
    ll ret = 1;
    for (int up = n, dwn = 1; dwn <= k; --up, ++dwn)
        ret = ret * up / dwn;
    return ret;
}
// #define C(n, k) (ll(n) * ((n) - 1) / (2))

void insert(int x) {
    now_ans -= C(cnt[x], 2);
    ++cnt[x];
    now_ans += C(cnt[x], 2);
}

void erase(int x) {
    now_ans -= C(cnt[x], 2);
    --cnt[x];
    now_ans += C(cnt[x], 2);
}

void modui() {
    bsiz = n / sqrt(m);
    sort(ask + 1, ask + 1 + m, coder);
    int s = 1, t = 0;
    for (int i = 1; i <= m; ++i) {
        int l = ask[i].l, r = ask[i].r;
        while (l < s) insert(a[--s]);
        while (t < r) insert(a[++t]);
        while (s < l) erase(a[s++]);
        while (r < t) erase(a[t--]);
        ask[i].ans = now_ans;
    }
}

int main() {
    n = rad(), m = rad();
    rf(i, n) a[i] = rad();
    rf(i, m) ask[i].l = rad(), ask[i].r = rad(), ask[i].id = i;
    modui();
    sort(ask + 1, ask + 1 + m);

    rf(i, m) {
        ll up = ask[i].ans;
        if (up == 0)
            puts("0/1");
        else {
            ll dwn = C(ask[i].r - ask[i].l + 1, 2), g = __gcd(up, dwn);
            printf("%lld/%lld\n", up / g, dwn / g);
        }
    }

    return 0;
}

T rad() {
    T back = 0;
    int ch = 0, posi = 0;
    for (; ch < '0' || ch > '9'; ch = getchar())
        posi = ch ^ '-';
    for (; ch >= '0' && ch <= '9'; ch = getchar())
        back = (back << 1) + (back << 3) + (ch & 0xf);
    return posi ? back : -back;
}